<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
#{extends 'main.html' /}
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Add</title>
</head>


<body>
	<h1>${date}</h1>
<div id="window" >
    ${flash.success}
</div>


	<form
		action="@{Tkalefs.create(docNumber,valNumber,opNumber,ayNumber,date)}">
		<input type="hidden" value=${date} name="date">
		<input type="hidden" id =  "msg" value=${flash.success}>
		<table align="center" border="5">

			<tr>
				<td><input type="text" name="docNumber" id="docNumber" required>
				</td>
				<td>: رقم المستند</td>

			</tr>

			<tr>
				<td><input type="text" name="valNumber" id="valNumber" required>
				</td>
				<td>: رقم القيمة</td>

			</tr>

			<tr>
				<td><input type="text" name="opNumber" id="opNumber" required>
				</td>
				<td>: رقم العملية</td>

			</tr>

			<tr>
				<td><input type="text" name="ayNumber" id="ayNumber" required>
				</td>
				<td>: رقم اي حاجة</td>

			</tr>
			<tr>
				<td><input type="submit" value="حفظ"
					style="width: 200px; height: 50px;">
				</td>
			</tr>
		</table>
	</form>
</body>
<script>
	
	$(document).ready(function() {
		$("#docNumber").kendoNumericTextBox({

			min : 0,
			max : 99999999,
			step : 1,
			format : "#"
		});
		$("#valNumber").kendoNumericTextBox({

			min : 0,
			max : 99999999,
			step : 1,
			format : "#"
		});
		$("#opNumber").kendoNumericTextBox({

			min : 0,
			max : 99999999,
			step : 1,
			format : "#"
		});
		$("#ayNumber").kendoNumericTextBox({

			min : 0,
			max : 99999999,
			step : 1,
			format : "#"
		});
		
		
	  
		 
		    
		    var x = document.getElementById('msg');
		    if(x.value != "")
		    	{

				$("#window").kendoWindow({
				    actions: ["Close"],
				    draggable: true,
				    height: "300px",
				    modal: true,
				   
				    pinned: false,
				    resizable: false,
				    title: "Success Window",
				    width: "auto",
				    height: "auto"
				});
				var win = $("#window").data("kendoWindow");
		    	win.center();
		    	win.open();
		    	}
		   
		
	

	});
</script>
</html>
